
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  set(SSL_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}/no-asm)
else()
  set(SSL_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR})
endif()

if(Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0)

  if(NOT OPENSSL_ROOT_DIR)
    set(OPENSSL_ROOT_DIR ${SSL_ROOT_PATH}/ssl_3/${CMAKE_ANDROID_ARCH_ABI})
  endif()
  list(APPEND ANDROID_EXTRA_LIBS
       ${SSL_ROOT_PATH}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so
       ${SSL_ROOT_PATH}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so)
else()
  if(NOT OPENSSL_ROOT_DIR)
    set(OPENSSL_ROOT_DIR ${SSL_ROOT_PATH}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI})
  endif()
  list(APPEND ANDROID_EXTRA_LIBS
       ${SSL_ROOT_PATH}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_1_1.so
       ${SSL_ROOT_PATH}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libssl_1_1.so)
endif()
